package com.design.pattern.entry.fruit;

import com.design.pattern.action.visit.Visit;
import com.design.pattern.entry.Fruit;
import com.design.pattern.entry.bag.OrangeBag;

/**
 * 橘子
 *
 * @author gyf
 * @create 2018-11-30 13:54
 **/
public class Orange implements Fruit {
    private String name = "";
    private int price = 79;

    public Orange(String name, int price) {
        this.price = price;
        this.name = name;
    }

    @Override
    public int price() {
        return price;
    }

    @Override
    public void draw() {
        System.out.println("砂糖橘子");
    }

    @Override
    public int accept(Visit visit) {
        return visit.sell(this);
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void pack(OrangeBag orangeBag) {
        orangeBag.pack();
    }
}
